/**
 * @desc   系统
 * @param  {String}
 * @return {Boolean} 
 */

/* layout */
import Layout from '../views/layout/Layout';

/* logiLayout */
const logiLayout = resolve => require(['../views/layout/logiLayout'], resolve);

// 系统-权限管理
const authorityComponent = resolve => require(['../views/systemManage/authorityManagement'], resolve);
const addAuthority = resolve => require(['../views/systemManage/authorityManagement/addAuthor'], resolve);
const editAuthority = resolve => require(['../views/systemManage/authorityManagement/editAuthor'], resolve);
const showAuthority = resolve => require(['../views/systemManage/authorityManagement/showAuthor'], resolve);
// 系统-省市区
const province = resolve => require(['../views/systemManage/provinceCityArea/province'], resolve);
const city = resolve => require(['../views/systemManage/provinceCityArea/city'], resolve);
const area = resolve => require(['../views/systemManage/provinceCityArea/area'], resolve);
// 系统-字典
const dictionary = resolve => require(['../views/systemManage/dictionary/dictionary'], resolve);
// 系统-敏感字
const sensitiveWord = resolve => require(['../views/systemManage/sensitiveWord/sensitiveWord'], resolve);
// 验证码查询
const identifyingCode = resolve => require(['../views/systemManage/identifyingCode/identifyingCode'], resolve);
//举报管理
const reportManage = resolve => require(['../views/reportManagement/reportManage'], resolve);
// 系统-----系统和版本 
const systemLog = resolve => require(['../views/systemManage/systemVersion/systemLog'], resolve); //系统日志
const versionMangement = resolve => require(['../views/systemManage/systemVersion/versionMangement'], resolve); //版本管理

// 系统
export const systemRouterMap = [{
        path: '/',
        redirect: '/systemLog',
        name: '系统',
        hidden: true
    }, {
        path: '/authority',
        redirect: 'authority/index',
        component: Layout,
        icon: 'quanxian',
        name: "权限管理",
        noDropdown: true,
        meta: {
            cache: 'authorityComponent'
        },
        children: [
            { path: 'index', component: authorityComponent, name: '权限管理' },
            { path: 'addAuthor', component: addAuthority, name: '添加权限' },
            { path: 'editAuthor/:pId', component: editAuthority, name: '修改权限' },
            { path: 'showAuthor/:pId', component: showAuthority, name: '查看权限' }
        ]
    }, {
        path: '/system',
        redirect: '/system/province',
        name: '系统管理',
        component: Layout,
        icon: 'zujian',
        meta: {
            role: ['admin', '系统管理'],
            cache: 'province,city,area,dictionary,sensitiveWord'
        },
        noDropdown: false,
        children: [
            { path: 'province', component: province, name: '省管理' },
            { path: 'city', component: city, name: '市管理' },
            { path: 'area', component: area, name: '区管理' },
            { path: 'dictionary', component: dictionary, name: '字典' },
            { path: 'sensitiveWord', component: sensitiveWord, name: '敏感字' },
            { path: 'identifyingCode', component: identifyingCode, name: '验证码查询' }
        ]
    }, {
        path: '/reportManagement',
        redirect: '/reportManagement/reportManage',
        name: '举报管理',
        component: Layout,
        icon: 'zujian',
        meta: {
            role: ['admin', '举报管理'] ,
            cache: 'reportManage'
           },
        noDropdown: true,
        children: [
            { path: 'reportManage', component: reportManage, },
        ]
    },
    {
        path: '/systemLog',
        redirect: 'systemLog/index',
        component: Layout,
        icon: 'EXCEL',
        name: "系统日志",
        noDropdown: true,
        children: [
            { path: 'index', component: systemLog },
        ]
    },
    {
        path: '/versionMangement',
        redirect: 'versionMangement/index',
        component: Layout,
        icon: 'zujian',
        name: "版本管理",
        noDropdown: true,
        children: [
            { path: 'index', component: versionMangement },
        ]
    },
];

export default systemRouterMap;